﻿<UserControl x:Class="Notoric.View.Music.CWNotation.Controls.Beam"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:vme="clr-namespace:Notoric.ViewModel.Elements.CWNotation;assembly=ViewModel"
             xmlns:cvr="clr-namespace:Notoric.View.Music.CWNotation.Converters"
            >
    <UserControl.Resources>
        <cvr:PointCollectionConverter x:Key="PointCollectionConverter"/>
    </UserControl.Resources>
    <Canvas>
        <ItemsControl ItemsSource="{Binding Segments, Mode=OneWay}">
            <ItemsControl.ItemsPanel>
                <ItemsPanelTemplate>
                    <Canvas Background="Transparent"/>
                </ItemsPanelTemplate>
            </ItemsControl.ItemsPanel>
            <ItemsControl.ItemTemplate>
                <DataTemplate DataType="{x:Type vme:BeamSegment}">
                    <Polygon Fill="Black" Points="{Binding Points, Mode=OneWay, Converter={StaticResource PointCollectionConverter}}"></Polygon>
                </DataTemplate>
            </ItemsControl.ItemTemplate>
        </ItemsControl>
    </Canvas>
</UserControl>
